package com.zyd.shiro.controller;

import com.zyd.shiro.business.consts.CommonConst;
import me.zhyd.braum.spring.boot.BraumProcessor;
import me.zhyd.braum.spring.boot.BraumResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther Cran
 * @data 2018/12/7 10:39
 */
@RestController
public class BraumController {
    @Autowired
    BraumProcessor processor;
    @Autowired
    HttpServletRequest request;
    @RequestMapping("/")
    public Object index() {
        BraumResponse r = processor.process(request);
        System.out.println(r.getCode()+"hahah");
        if (r.getCode() == CommonConst.ERROR) {

            return "你已涉嫌恶意访问被临时禁止，请文明上网";
        }
        return "Hello world!";
    }

}
